package com.fyzk.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fyzk.bean.FriendsBean;
import com.fyzk.utils.StringUtils;
import com.tyjc.lottery.R;

public class MyInvitationAdapter extends BaseQuickAdapter<FriendsBean, BaseViewHolder> {

    public MyInvitationAdapter() {
        super(R.layout.item_my_invitation);
    }

    @Override
    protected void convert(BaseViewHolder holder, FriendsBean item) {
        if (!TextUtils.isEmpty(item.getUserName())) {
            String userName = StringUtils.getFormatUserName(item.getUserName());
            holder.setText(R.id.myInvitationItem_tvUserName, userName);
        }

        if (!TextUtils.isEmpty(item.getLotteryOrderWater())) {
            holder.setText(R.id.myInvitationItem_tvInvestDetail, item.getLotteryOrderWater());
        }

        if (!TextUtils.isEmpty(item.getCommission())) {
            holder.setText(R.id.myInvitationItem_tvAward, item.getCommission());
        }
    }
}
